<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateHouseAttributeValuesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('house_attribute_values');
        # 房屋属性值；
        Schema::create('house_attribute_values', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('house_id')->default(0)->comment('房屋id');
            $table->integer('attribute_param_id')->nullable()->comment('属性id');
            $table->integer('value_param_id')->nullable()->comment('值参数值id');
            $table->string('text')->default('')->comment('文本值');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('hourse_attribute_values');
    }
}
